# _*_ coding : utf-8 _*_
# @Time : 2022/9/11 16:15
# @Author : 软柠柠吖
# @File : 016_break
# @Project : pythonProject

import xlrd
from xlutils.copy import copy

wb = xlrd.open_workbook(r'D:\桌面\test\test.xlsx')
ws = wb.sheet_by_name('业绩表')

nwb = copy(wb)
nws = nwb.get_sheet('业绩表')

# ['小王', 11.0, 15.0, 13.0, 5.0, 13.0, 4.0, 15.0, 8.0, 14.0, 2.0, 6.0, 9.0, '']
# print(ws.row_values(1))
ws_row = 1
while True:
    ws_col, count = 1, 0
    while True:
        count += ws.cell_value(ws_row, ws_col)
        if count >= 100:
            nws.write(ws_row, 13, '{}月'.format(ws_col))
            break
        elif ws_col >= 12:
            nws.write(ws_row, 13, '未达标！')
            break
        ws_col += 1
    ws_row += 1
    if ws_row > ws.nrows - 1:
        break
nwb.save(r'D:\桌面\test\test.xlsx')
